cmake_minimum_required(VERSION 3.18)
project(FunctionScopeDemo LANGUAGES CXX)

# 1. 函数作用域
set(SCOP "Directort Scop")
function(print_var)
    # 1. 获取父级目录变量
    message("1. func: ${SCOP}")
    # 2. 修改变量
    set(SCOP "Function Scop")
    message("2. func: ${SCOP}")
endfunction(print_var)

print_var()
message("3. main: ${SCOP}")

